<?php
/*
	监听系统用户登陆事件
*/
defined('BY_JYA') or exit('error');
if($event['user_type']==1){
	//操作员
	$clerk=$this->pdo_get('clerk',array('uid'=>$event['uid']));
	if($clerk){
		if($clerk['depot_id']){
			$depot=$this->pdo_get('depot',array('id'=>$clerk['store_id']));
			if(!$depot){
				return false;
				//model('core/user')->logout();
				//exi('指定仓库不存在！登陆失败！','error');
			}
			$this->session('store_id',$clerk['store_id']);
			if($clerk['group_id']){
				$this->session('group_id',$clerk['group_id']);
				$this->session('usertype','depot_operator');
			}else{
				$this->session('usertype','depot_admin');
			}
		}else{
			$this->session('usertype','core_operator');
		}
	}else{
		$this->session('usertype','core_operator');
	}
}else{
	$this->session('usertype','core_operator');
}